﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/view/include/inc.jsp"%>
<!DOCTYPE html>
<html lang="en">
<head>
<%@ include file="/WEB-INF/view/jQgrid.jsp"%>
</head>
<body style="background-color: white;" class="gray-bg">
	<div class="ibox-content">
		<form class="form-horizontal" id="signupForm" role="form" method="post" enctype="multipart/form-data">
		<input type="hidden" name="resumeId"  id="resumeId" value="${resumeId }" />
			<div class="form-group">
				<label class="col-sm-3 control-label">企业需求：</label>
				<div class="col-sm-8">
					<select class="form-control selectpicker"  id="projectId" name="projectId" data-live-search="true">
					<option value="">===请选择===</option>
					<c:forEach items="${demandEnterprises }" var="demand">
					<option value="${demand.id }">${demand.positionName}-/-${demand.company.name}-/-${demand.createDate.substring(0,10)}</option>
					</c:forEach>
					</select>
				    <p class="help-block" style="color: red;">*必填项，请选择企业需求</p>
				</div>
			</div>
			<div class="form-group" style="text-align: center;">
				<div class="col-sm-12">
					<button class="btn btn-primary" type="button" id="sub">提交</button>
				</div>
			</div>
		</form>
		</div>
<script type="text/javascript">
$(function () {
	$(".selectpicker" ).selectpicker('refresh');
	$("#sub").click(function () {
		 if($("#projectId").val()==''){
   		  $("#projectId").tips({
					side:3,
		            msg:'企业需求未选择',
		            bg:'#AE81FF',
		            time:1
		        });
   		  $("#projectId").focus();
				return;
		}
	  $("#signupForm").ajaxSubmit({
        url: '<%=contextPath%>/resume/addProject',
			type : 'post',
			dataType : "json",
			success : function(data) {
				if (data.code == 200) {
					swal({
						title : data.message,
						type : "success",
						showCancelButton : false,
						confirmButtonText : "确定",
						animation : "slide-from-bottom",
						closeOnConfirm : true
					}, function() {
						top.Dialog.close();
					});
				} else {
					swal("错误", data.message, "error");
				}
			}
		});
	});
})
</script>
</body>
</html>

